CONTENTS | INDEX | PREV | NEXT
 chkabort

 NAME
  chkabort - check for ^C and take the appropriate action

 SYNOPSIS
  (void) chkabort(void);

 FUNCTION
  Checks for a ^C and takes the appropriate action.  If the appropriate
  action is to exit than this routine does not return.  stdio and other
  routines will call chkabort() at various points.

  The action taken by ^C may be set by the signal() or onbreak() calls.

 EXAMPLE
  /*
   *  wait for somebody to hit ^C (note that this is very wasteful of
   *  CPU and thus isn't a real good example).
   */

  main()
  {
      int i;

      for (i = 0; i < 10000000; ++i)
      chkabort();
      return(0);
  }

 SEE ALSO
  atexit, signal